Stop using deprecated style context api
authorMatthias Clasen <mclasen@redhat.com>
Sun, 31 Mar 2019 19:03:57 +0000 (15:03 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 31 Mar 2019 19:35:20 +0000 (15:35 -0400)
Use the non-deprecated one it wraps, instead.
Yes, this is cheating...

gtk/gtkflowbox.c
gtk/gtkpopover.c
gtk/gtkstylecontext.c
gtk/gtktextdisplay.c
gtk/gtktextutil.c
gtk/gtktextview.c

index 65c491fe4b9e6ee32f37cd75adf7cd0abf7efaa1..015a48e8ab6a3faa0b584b9d9259ae5b6a689fcb 100644 (file)
@@ -2382,9 +2382,7 @@ gtk_flow_box_snapshot (GtkWidget   *widget,
           cairo_append_path (cr, path);
           cairo_path_destroy (path);
 
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-          gtk_style_context_get_border_color (context, &border_color);
-G_GNUC_END_IGNORE_DEPRECATIONS
+          gtk_style_context_get (context, "border-color", &border_color, NULL);
           gtk_style_context_get_border (context, &border);
 
           cairo_set_line_width (cr, border.left);
index a39270c5a792438353d95500bca556f2d8b5460d..dba89e511c3eb2405268d3a0d31429c8a3e2878b 100644 (file)
@@ -1310,10 +1310,8 @@ gtk_popover_snapshot (GtkWidget   *widget,
   if (border.bottom > 0)
     {
       GdkRGBA border_color;
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-      gtk_style_context_get_border_color (context, &border_color);
-G_GNUC_END_IGNORE_DEPRECATIONS
 
+      gtk_style_context_get (context, "border-color", &border_color, NULL);
       gtk_popover_apply_tail_path (popover, cr);
       gdk_cairo_set_source_rgba (cr, &border_color);
 
index e765c852dc68961077501b7200a82f8d83221c7f..81384cc0c98c28e16446dbb9eb8222d2610848ef 100644 (file)
@@ -1992,9 +1992,7 @@ _gtk_style_context_get_attributes (AtkAttributeSet *attributes,
   GdkRGBA color;
   gchar *value;
 
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  gtk_style_context_get_background_color (context, &color);
-G_GNUC_END_IGNORE_DEPRECATIONS
+  gtk_style_context_get (context, "background-color", &color, NULL);
   value = g_strdup_printf ("%u,%u,%u",
                            (guint) ceil (color.red * 65536 - color.red),
                            (guint) ceil (color.green * 65536 - color.green),
index 4e6c49fd1683f78b3be710586a9a71327f86088c..3f38112c8897a15eae6a73ba496fabb38873a49c 100644 (file)
@@ -580,11 +580,9 @@ render_para (GtkTextRenderer    *text_renderer,
   selection_node = gtk_text_view_get_selection_node ((GtkTextView*)text_renderer->widget);
   gtk_style_context_save_to_node (context, selection_node);
 
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  gtk_style_context_get_background_color (context, &selection);
-G_GNUC_END_IGNORE_DEPRECATIONS
+  gtk_style_context_get (context, "background-color", &selection, NULL);
 
- gtk_style_context_restore (context);
 gtk_style_context_restore (context);
 
   do
     {
@@ -775,9 +773,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
                 {
                   GdkRGBA color;
 
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-                  gtk_style_context_get_background_color (context, &color);
-G_GNUC_END_IGNORE_DEPRECATIONS
+                  gtk_style_context_get (context, "background-color", &color, NULL);
 
                   gdk_cairo_set_source_rgba (cr, &color);
 
index 9858bec5ad50ae2af4ade9f387d56705d1d3a5e9..651b92abd992033a09d52feb3d3adb7bf1bf564a 100644 (file)
@@ -250,9 +250,7 @@ set_attributes_from_style (GtkStyleContext   *context,
   if (!values->appearance.fg_rgba)
     values->appearance.fg_rgba = gdk_rgba_copy (&black);
 
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  gtk_style_context_get_background_color (context, values->appearance.bg_rgba);
-G_GNUC_END_IGNORE_DEPRECATIONS
+  gtk_style_context_get (context, "background-color", values->appearance.bg_rgba, NULL);
   gtk_style_context_get_color (context, values->appearance.fg_rgba);
 
   if (values->font)
index 0f378211e84c316c9d7dbb2f5b1962fe6f6ced95..00fa5ce0dd82d2bc3797581496bd373cf7677140 100644 (file)
@@ -7310,9 +7310,7 @@ gtk_text_view_set_attributes_from_style (GtkTextView        *text_view,
 
   context = gtk_widget_get_style_context (GTK_WIDGET (text_view));
 
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  gtk_style_context_get_background_color (context, values->appearance.bg_rgba);
-G_GNUC_END_IGNORE_DEPRECATIONS
+  gtk_style_context_get (context, "background-color", values->appearance.bg_rgba, NULL);
   gtk_style_context_get_color (context, values->appearance.fg_rgba);
 
   if (values->font)